****************************************************************************************************************************************
* Reproduction file for "The globalisation divide in the public mind: Belief systems on globalisation and their electoral consequences *
****************************************************************************************************************************************

* This do file creates the findings based on the Manifesto Project 

* set version
version 15.1

* install graph schemes, if necessary
* ssc install blindschemes, all

* set graph scheme to plotplainblind
set scheme plotplainblind

* install ados used, if necessary
* ssc install ciplot

* Download Manifesto Dataset from: https://manifesto-project.wzb.eu/datasets
	*	Citation: Volkens, Andrea / Krause, Werner / Lehmann, Pola / Matthieß, Theres / Merz, Nicolas / Regel, Sven / Weßels, Bernhard (2019): 
	*	The Manifesto Data Collection. Manifesto Project (MRG/CMP/MARPOR). Version 2019a. 
	* 	Berlin: Wissenschaftszentrum Berlin für Sozialforschung (WZB). https://doi.org/10.25522/manifesto.mpds.2019a

* Open Manifesto data
use "MPDataset_MPDS2019a_stata14.dta", replace



**************** Recode positions *************

	* free trade
	gen freetrade=per407-per406
	label variable freetrade "net"
	clonevar protectionism_neg=per407
	label variable protectionism_neg "positive"
	gen protectionism_pos=-per406
	label variable protectionism_pos "negative"

	* EU
	gen EU=per108-per110
	label variable EU "net"
	clonevar EU_pos=per108
	label variable EU_pos "positive"
	gen EU_neg=-per110
	label variable EU_neg "negative"
	
	* internationalism
	gen internationalism=per107-per109
	label variable internationalism "net"
	clonevar internationalism_pos=per107
	label variable internationalism_pos "positive"
	gen internationalism_neg=-per109
	label variable internationalism_neg "negative"	

	* multiculturalism	
	gen multicult=per607-per608
	label variable multicult "net"
	clonevar multicult_pos=per607
	label variable multicult_pos "positive"
	gen multicult_neg=-per608
	label variable multicult_neg "negative"
	
	* redistribution (welfare state and economic intervention)
	gen redistribution_pos=(per403+per412+per504)/3
	label variable redistribution_pos "positive"
	gen redistribution_neg=(-per401-per414-per505)/3
	label variable redistribution_neg "negative"
	gen redistribution=redistribution_pos+redistribution_neg
	label variable redistribution "net"
	
	* cultural liberalism (-traditional morality)
	gen cult_lib=per604-per603
	label variable cult_lib "net"
	clonevar cult_lib_pos=per604
	label variable cult_lib_pos "positive"
	gen cult_lib_neg=-per603
	label variable cult_lib_neg "negative"
	
	* civil liberties (law & order vs. freedom and human rights)
	gen civil_liberties=per201-per605
	label variable civil_liberties "net"
	clonevar civil_liberties_pos=per201
	label variable civil_liberties_pos "positive"
	gen civil_liberties_neg=-per605
	label variable civil_liberties_neg "negative"
	

******** Create identifier for German parties in the desired order *************

gen GERparty=1 if partyabbrev=="CDU/CSU"
replace GERparty=2 if partyabbrev=="FDP"
replace GERparty=3 if partyabbrev=="SPD"
replace GERparty=4 if partyabbrev=="90/Greens"
replace GERparty=5 if partyabbrev=="LINKE"
replace GERparty=6 if partyabbrev=="AfD"

label define GERparty 1 "CDU/CSU" 2 "FDP" 3 "SPD" 4 "Greens" 5 "Left" 6 "AfD"
label values GERparty GERparty



**************** Article *************


**************** FIGURE 1: Party positions on globalisation related issues in the 2017 German election *************

ciplot freetrade if country==41 & date==201709, by(GERparty) ///
		msymbol(diamond) mcolor(black) ///
		xline(0, lcolor(gs0) lwidth(thin)) horizontal note(" ") ytitle(" ") xtitle("free trade", size(medsmall)) name(gr1, replace)
				
ciplot EU if country==41 & date==201709, by(GERparty) ///
		msymbol(diamond) mcolor(black) ///
		xline(0, lcolor(gs0) lwidth(thin)) horizontal note(" ") ytitle(" ") xtitle("EU", size(medsmall)) name(gr2, replace) 
		
ciplot internationalism if country==41 & date==201709, by(GERparty) ///
		msymbol(diamond) mcolor(black) ///
		xline(0, lcolor(gs0) lwidth(thin)) horizontal note(" ") ytitle(" ") xtitle("internationalism", size(medsmall)) name(gr3, replace)
		
ciplot multicult if country==41 & date==201709, by(GERparty) ///
		msymbol(diamond) mcolor(black) ///
		xline(0, lcolor(gs0) lwidth(thin)) horizontal note(" ") ytitle(" ") xtitle("multiculturalism", size(medsmall)) name(gr4, replace)

graph combine gr1 gr2 gr3 gr4, xcommon imargin(zero) iscale(*1.5) xsize(7)
graph export Figure1.pdf


**************** Appendix *************


**************** FIGURE A1: Party positions on globalisation related issues in the 2017 German election *************

ciplot freetrade protectionism_neg protectionism_pos if country==41 & date==201709, by(GERparty) ///
		xline(0) horizontal note(" ") ytitle(" ") msymbol(diamond o o) mcolor(black midgreen red) msize(small vsmall vsmall) legend(off) xtitle("free trade", size(medsmall)) name(gr1, replace)
				
ciplot EU EU_pos EU_neg if country==41 & date==201709, by(GERparty) ///
		xline(0) horizontal note(" ") ytitle(" ") msymbol(diamond o o) mcolor(black midgreen red) msize(small vsmall vsmall) legend(off) xtitle("EU", size(medsmall)) name(gr2, replace) 
		
ciplot internationalism internationalism_pos internationalism_neg if country==41 & date==201709, by(GERparty) ///
		xline(0) horizontal note(" ") ytitle(" ") msymbol(diamond o o) mcolor(black midgreen red) msize(small vsmall vsmall) legend(off) xtitle("internationalism", size(medsmall)) name(gr3, replace)
		
ciplot multicult multicult_pos multicult_neg if country==41 & date==201709, by(GERparty) ///
		xline(0) horizontal note(" ") ytitle(" ") msymbol(diamond o o) mcolor(black midgreen red) msize(small vsmall vsmall) legend(off) xtitle("multiculturalism", size(medsmall)) name(gr4, replace)

ciplot redistribution redistribution_pos redistribution_neg if country==41 & date==201709, by(GERparty) ///
		xline(0) horizontal note(" ") ytitle(" ") msymbol(diamond o o) mcolor(black midgreen red) msize(small vsmall vsmall) legend(off) xtitle("redistribution", size(medsmall)) name(gr5, replace) 

ciplot cult_lib cult_lib_pos cult_lib_neg if country==41 & date==201709, by(GERparty) ///
		xline(0) horizontal note(" ") ytitle(" ") msymbol(diamond o o) mcolor(black midgreen red) msize(small vsmall vsmall) legend(off) xtitle("cultural liberalism", size(medsmall)) name(gr6, replace) 

ciplot civil_liberties civil_liberties_pos civil_liberties_neg if country==41 & date==201709, by(GERparty) ///
		xline(0) horizontal note(" ") ytitle(" ") msymbol(diamond o o) mcolor(black midgreen red) msize(small vsmall vsmall) legend(off) xtitle("civil liberties", size(medsmall)) name(gr7, replace) 
		
graph combine gr1 gr2 gr3 gr4 gr5 gr6 gr7, cols(2) xcommon imargin(zero) iscale(*1.0) ysize(6)



**************** TABLE A1: Pairwise correlations between (net) party positions in the 2017 German election *************

pwcorr freetrade EU internationalism multicult redistribution cult_lib civil_liberties if country==41 & date==201709, sig
